//public class Demo3 {
////    public static int[] newArray(int[] oldArray) {
////        int len = oldArray.length;
////        int[] newArray;
////        if (len % 2 == 0) {
////            newArray = new int[len - 2];
////            int middle = len / 2;
////            for (int i = 0; i < newArray.length; i++) {
////                if (i < middle - 1) {
////                    newArray[i] = oldArray[i];
////                } else {
////                    newArray[i] = oldArray[i + 2];
////                }
////            }
////        } else {
////            newArray = new int[len - 1];
////            int middle = len / 2 + 1;
////            for (int i = 0; i < newArray.length; i++) {
////                if (i < middle - 1) {
////                    newArray[i] = oldArray[i];
////                } else {
////                    newArray[i] = oldArray[i + 1];
////                }
////            }
////        }
////        return newArray;
////    }
////
////    public static void main(String[] args) {
////
////        int[] arr = new int[]{5, 7, 9, 6, 5, 3};
////        int[] newArrar = newArray(arr);
////        for (int e : newArrar) {
////            System.out.println(e);
////        }
////    }
//
//    public static void main(String[] args) {
//        int num=2<<3;
//        System.out.println(num);
//}}
public class Demo3 {
    // 已知7位同学的考试成绩，请找出最⾼分、最低分。
    public static int[] getMaxMin(int[] array) {
        int[] arrmaxmin = new int[2];
        int max = array[0], min = array[0];
        for (int i = 0; i < array.length - 1; i++) {
            if (max < array[i]) {
                max =array[i];
            }
            if (min > array[i]) {
                min =array[i];
            }
        }
        arrmaxmin[0] = max;
        arrmaxmin[1] = min;
        return arrmaxmin;
    }

    public static void main(String[] args) {
        int i=0;
        int[] arr = {2, 4, 19, 11, 3};
        int[] maxmin=new int[arr[i]];
        maxmin = getMaxMin(arr);
        for (int e : maxmin) {
            System.out.println(e);
                 }
    }
}
